package com.wcfsy.wechat.wx.util;

import java.io.Serializable;

public class JsonMessage implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String success;
	private String code;
	private String message;
	private Object data;

	public static JsonMessage getSuccessJson(Object data) {
		JsonMessage jsonMessage = new JsonMessage();
		jsonMessage.setSuccess("succeed");
		jsonMessage.setMessage("操作成功");
		jsonMessage.setData(data);
		jsonMessage.setCode("0");
		return jsonMessage;
	}
	
	public static JsonMessage getErrorJson(Object data) {
		JsonMessage jsonMessage = new JsonMessage();
		jsonMessage.setSuccess("error");
		jsonMessage.setMessage("操作失败");
		jsonMessage.setData(data);
		jsonMessage.setCode("-1");
		return jsonMessage;
	}
	
	public static JsonMessage getWCFSYSuccessJson(String id) {
		JsonMessage jsonMessage = new JsonMessage();
		jsonMessage.setSuccess("succeed");
		jsonMessage.setMessage(id);
		jsonMessage.setCode("0");
		return jsonMessage;
	}

	public static JsonMessage getSuccessJson(String msg) {
		JsonMessage jsonMessage = new JsonMessage();
		jsonMessage.setSuccess("succeed");
		jsonMessage.setMessage(msg);
		jsonMessage.setCode("0");
		return jsonMessage;
	}

	public static JsonMessage getErrorJson(String msg) {
		JsonMessage jsonMessage = new JsonMessage();
		jsonMessage.setSuccess("error");
		jsonMessage.setMessage(msg);
		jsonMessage.setCode("-1");
		return jsonMessage;
	}

	public static JsonMessage getErrorJson() {
		JsonMessage jsonMessage = new JsonMessage();
		jsonMessage.setSuccess("error");
		jsonMessage.setMessage("操作失败");
		jsonMessage.setCode("-1");
		return jsonMessage;
	}

	public Object getData() {
		return this.data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public String getSuccess() {
		return this.success;
	}

	public void setSuccess(String success) {
		this.success = success;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return this.message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}